package main;

public class Sprite implements Commons {
	protected boolean visible;
	protected int x;
	protected int y;
	protected boolean isDead;
	protected int dx;
	protected int dy;
	protected int health;
	protected int Shield;
	
	public Sprite(){
		this.visible = true;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public int getHealth() {
		return health;
	}
	
	public int getShield() {
		return Shield;
	}

	public void setHealth(int health) {
		this.health = health;
	}

	public boolean isDead() {
		if(getHealth()<= 0){
			return true;
		}
		else return false;
		
	}

	public void setVisible(boolean visible) {
		if(isDead()){
			this.visible = false;
		}
		else this.visible = true;
	}
	
	public void move(int dx, int dy){
		if((getX()+dx >= BOARD_WIDTH || getX() + dx < 0) && (getY() + dy >= BOARD_HEIGHT || getY() + dy < 0)){
			this.x += dx;
			this.y += dy;
		}
	}
	
	
	
	
	
	
	
	
	
	
}
